<%@ page import="org.xilin.Family" %>
<%@ page import="org.xilin.Student" %>

<div class="GFBox" style="margin-left: 20px; margin-right: 80px;">
  <g:if test="${flash.message}">
    <div class="message">${flash.message}</div>
  </g:if>
  <div>
    <table border="1" class="tablesorter">
      <thead><b>Student Info</b></thead>
      <tbody>
      <g:each in="${familyInstance?.students?}" status="i" var="s">
      <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
        <td>${s?.firstName + ' ' + s?.lastName} </td>
        <td class="edit"><a href="#" title="Edit Student" rel="${request.contextPath}/student/edit/${s?.id}"><span class="ui-icon ui-icon-pencil"/></a></td>
        <td class="delete"><g:remoteLink action="delete" update="content" id="${s?.id}"><span class="ui-icon ui-icon-trash"/></g:remoteLink></td>
        <td><g:remoteLink controller="family" action="deleteStudent" id="${s?.id}"> Delete </g:remoteLink></td>
      </tr>
      </g:each>
      </tbody>
    </table>
  </div>
</div>